import React from "react";
import { Modal, Form, Input } from "antd";
import { modalPropsType } from "@/constants/types";

const {Item} = Form;

const OrderVerifyRemark = ({visible, loading, onCancel, onSubmit, title}: modalPropsType) => {
  const [form] = Form.useForm();

  const handleSubmit = async () => {
    const res = await form.validateFields();
    onSubmit(res);
  }
  return (
    <Modal
      title={title}
      open={visible}
      onOk={handleSubmit}
      onCancel={onCancel}
      maskClosable={false}
      confirmLoading={loading}
    >
      <Form form={form}>
        <Item name="remark" rules={[{required: true, message: '请备注说明原因'}]}>
          <Input.TextArea rows={3} placeholder="审核不通过，请备注说明原因" />
        </Item>
      </Form>
    </Modal>
  );
}
export default OrderVerifyRemark;